﻿define(
    ['services/dataservice.productcategory', 
    'model.mapper/model.mapper.productcategory', 
    'repositories/repository.entitySet'],
    function (dataservice, mapper, entitySet) {
    	
        var productCategories = new entitySet(dataservice.getProductCategories, mapper);

        productCategories.getProductCategories = function (options) {
    		return $.Deferred(function (def) {
    		    $.when(productCategories.getData(options, dataservice.getProductCategories))
                    .done(function () {
                        def.resolve();
                    })
                    .fail(function () {
                        def.reject();
                    });
    		}).promise();
    	};    

        return productCategories;
    });